<script type="text/javascript">
$(document).ready(function() {
	setTimeout(function(){
	  $("#kotak").fadeOut("slow", function () {
		$("#kotak").remove();
	  });    
	}, 3000);
	
});
function expand_this(hidden_div)
{
	$("#"+hidden_div).slideToggle(300);
	return false;
}
function toggle_div(param)
{
	$('#change_image_link, #change_image').toggle();
	if(param==true){
		$('#file-wrapper').html('');
	}
	else{
		$('#file-wrapper').html('<input id="image_file" type="file" name="image_file" class="text">');
	}
	return false;
}
</script>

<style type="text/css">
      #kotak {
        width: 250px;
        height: 20px;
      }
</style>
<div class="left"></div>
<div class="right"></div>
<div class="heading">
	<h1 style="background-image: url('<?php echo base_url()?>assets/images/product.png');">Lookbook</h1>
</div>
<div class="yui-gc wrapper">
<h1>Edit Lookbook</h1>
<?php echo $this->session->flashdata('message_type');?>
<form id="add_product_form" action="" method="post" enctype="multipart/form-data">
    <div class="yui-u first">
        <fieldset>
		<legend>Lookbook</legend>
		<ul>
			<li>
				<label for="image_file">File Foto</label>
				<div class="lookbook-container border-box">
					<div class="lookbook-image">
						<img src="<?php echo base_url().'public/look_book/'.$lookbook->look_img_url?>" width="300">
					</div>
					<div id="change_image_link" class="change_image_link"><a href="" class="button" onclick="toggle_div(false);return false;">Ganti Gambar</a></div>
					<div id="change_image" class="lookbook-image-file hidden">
						<label for="image_file">Pilih File Foto</label>
						<?php echo form_error('image_file', '<div class="error">', '</div>'); ?>
						<span id="file-wrapper">
						<input id="image_file" type="file" name="image_file" class="text"></span><br>
						atau <a href="" class="" onclick="toggle_div(true);return false;">Batal</a>
					</div>
				</div>
				<div style="clear:both;"></div>
			</li>
			<li>
				<label for="judul">Judul</label>
				<?php echo form_error('judul', '<div class="error">', '</div>'); ?>
				<input id="judul" type="text" name="judul" class="text" value="<?php echo $lookbook->judul?>">
			</li>
			<li>
				<label for="deskripsi">Deskripsi</label>
				<?php echo form_error('deskripsi', '<div class="error">', '</div>'); ?>
				<textarea id="deskripsi" name="deskripsi"><?php echo $lookbook->deskripsi?></textarea>
			</li>
			<li>
				<div style="display:block;height:40px;width:100%;clear:both;float:left;"></div>
			</li>
		</ul>
		</fieldset>
    </div>
	
<div class="yui-u">
	<fieldset>
		<legend>Detail Lookbook</legend>
		<ul>
			<li>
				<label for="status">Status</label>
				<?php echo form_error('status', '<div class="error">', '</div>'); ?>
				<?php echo booleanValueStatus($lookbook->status,'status')?>
			</li>
			<li>
				<input id="lookbook_id" type="hidden" name="lookbook_id" value="<?php echo $lookbook->lookbook_id?>">
				<input type="submit" value="Simpan"> atau <?php echo anchor('backend/lookbook','Batalkan')?>
			</li>
		</ul>
	</fieldset>
</div>
</form>
</div>